{% extends 'base.html' %}
{% from "macros.html" import table_df %}

{% block title %}Awesome-pyecharts{% endblock title %}



{% block show %}
    <div id="funnel" class = diva></div>
    <div id="map" class = diva></div>
    {{ table_df(df) }}
{% endblock %}


{% block scripts %}
    <!-- #JavaScript脚本 -->
    <script>
        $(
            function () {
                var chart = echarts.init(document.getElementById('funnel'), 'white', {renderer: 'canvas'});   // getElemementBYID("名称")  和上面的DIV  的ID要一样
                $.ajax({
                    type: "GET",
                    url: "{{ url_for("get_funnel_base") }}",
                    dataType: 'json',
                    success: function (result) {
                        chart.setOption(result);
                    }
                });
            }
        )
    </script>
    <script>
        $(
            function () {
                var chart = echarts.init(document.getElementById('map'), 'white', {renderer: 'canvas'});   // getElemementBYID("名称")  和上面的DIV  的ID要一样
                $.ajax({
                    type: "GET",
                    url: "{{ url_for("get_map_data") }}",
                    dataType: 'json',
                    success: function (result) {
                        chart.setOption(result);
                    }
                });
            }
        )
    </script>
{% endblock scripts %}